package com.nengchuan.eic.nceconomy.dao;

import com.nengchuan.eic.nceconomy.entity.dto.ExcelDetailDTO;
import com.nengchuan.eic.nceconomy.entity.po.OriginIndexData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nengchuan.eic.nceconomy.entity.vo.IndexSearchVO;
import com.nengchuan.eic.nceconomy.entity.vo.OriginIndexDataHaveSon;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 原始和指标数据表 Mapper 接口
 * </p>
 *
 * @author luoping
 * @since 2020-04-23
 */
@Repository
public interface OriginIndexDataMapper extends BaseMapper<OriginIndexData> {
    /**
     * 查询sheet详情
     * @param excelDetailDTO
     * @return
     */
    List<OriginIndexData> selectSheetDetailOrderByLineAndSeqAsc(ExcelDetailDTO excelDetailDTO);

    int insertList(@Param("data") List<OriginIndexData> data);

    int logicDeleteByExcelIdIn(@Param("ids")List<Long> ids,@Param("userId")Long userId,@Param("userName")String userName,@Param("time")Long time);

    /**
     * 查询父节点
     * @param excelDetailDTO
     * @return
     */
    List<OriginIndexData> selectSheetDetailOnParentNode(ExcelDetailDTO excelDetailDTO);

    /**
     * 根据父id查询sheetList
     * @param id
     * @param sheetId
     * @return
     */
    List<OriginIndexDataHaveSon> getSheetListByPid(@Param("id") Long id, @Param("sheetId") Long sheetId);

    void updateConfirmData(@Param("sheetId")Long sheetId, @Param("lineNum") Integer lineNum);

    List<IndexSearchVO> findValueByParams(@Param("index")String index, @Param("sheetName")String sheetName,@Param("category")List<String> category,@Param("projectIndex") String projectIndex,@Param("projectId") Long projectId, @Param("pid")Long pid);
}
